package com.hdd.biz.painting.controller;


import com.hdd.biz.painting.dto.*;
import com.hdd.biz.painting.service.MaterialKindService;
import com.hdd.dto.SuperResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 裱框背景分类表 前端控制器
 * </p>
 *
 * @author fang
 * @since 2021-03-09
 */
@RestController
@RequestMapping("/painting/materialKind")
@Api(value = "素材分类",tags = {"素材分类"})
@CrossOrigin(origins = "*",maxAge = 3600)
public class MaterialKindController {


    @Autowired
    private MaterialKindService materialKindService;

    @PostMapping("/materialKindList")
    @ApiOperation(value = "裱框列表" ,notes = "")
    public SuperResponse materialKindList(@Valid @RequestBody MaterialKindListRequest request ){
        return materialKindService.materialKindList(request);
    }


    @PostMapping("/materialAdd")
    @ApiOperation(value = "裱框添加" ,notes = "")
    public SuperResponse materialAdd(@Valid @RequestBody MaterialKindInfoRequest request ){
        return materialKindService.materialAdd(request);
    }


    @PostMapping("/materialDel")
    @ApiOperation(value = "裱框删除" ,notes = "")
    public SuperResponse materialdel(@Valid @RequestBody MaterialKindRequest request ){
        return materialKindService.materialdel(request);
    }


    @PostMapping("/materialUpdate")
    @ApiOperation(value = "裱框修改" ,notes = "")
    public SuperResponse materialUpdate(@Valid @RequestBody MaterialKindInfoRequest request ){
        return materialKindService.materialUpdate(request);
    }


    @PostMapping("/backdropList")
    @ApiOperation(value = "背景列表" ,notes = "")
    public SuperResponse backdropList(@Valid @RequestBody BackdropListRequest request ){
        return materialKindService.backdropList(request);
    }


    @PostMapping("/backdropAdd")
    @ApiOperation(value = "背景添加" ,notes = "")
    public SuperResponse backdropAdd(@Valid @RequestBody BackdropInfoRequest request ){
        return materialKindService.backdropAdd(request);
    }


    @PostMapping("/backdropDel")
    @ApiOperation(value = "背景删除" ,notes = "")
    public SuperResponse backdropDel(@Valid @RequestBody MaterialKindRequest request ){
        return materialKindService.backdropDel(request);
    }


    @PostMapping("/backdropUpdate")
    @ApiOperation(value = "背景修改" ,notes = "")
    public SuperResponse backdropUpdate(@Valid @RequestBody BackdropInfoRequest request ){
        return materialKindService.backdropUpdate(request);
    }



    @PostMapping("/colorAdd")
    @ApiOperation(value = "颜色添加" ,notes = "")
    public SuperResponse colorAdd(@Valid @RequestBody ColorInfoRequest request ){
        return materialKindService.colorAdd(request);
    }


    @PostMapping("/colorDel")
    @ApiOperation(value = "颜色删除" ,notes = "")
    public SuperResponse colorDel(@Valid @RequestBody MaterialKindRequest request ){
        return materialKindService.colorDel(request);
    }


    @PostMapping("/colorUpdate")
    @ApiOperation(value = "颜色修改" ,notes = "")
    public SuperResponse colorUpdate(@Valid @RequestBody ColorInfoRequest request ){
        return materialKindService.colorUpdate(request);
    }


    @PostMapping("/colorList")
    @ApiOperation(value = "颜色列表" ,notes = "")
    public SuperResponse colorList(@Valid @RequestBody ColorListRequest request ){
        return materialKindService.colorList(request);
    }


    @PostMapping("/info")
    @ApiOperation(value = "素材详情" ,notes = "")
    public SuperResponse info(@Valid @RequestBody MaterialKindRequest request ){
        return materialKindService.materialKindInfo(request);
    }
}




